﻿


using HumanWorkflow.Framework;
using HumanWorkflow.SemanticModel;

namespace OrderWorkflow.OrderWorkflowWithExternalDsl
{
	public partial class OrderWorkflowWithExternalDsl
	{
		public static HumanWorkflowSemanticModel InitializeSemanticModel()
		{
			HumanWorkflowSemanticModel semanticModel = new HumanWorkflowSemanticModel();
		
			semanticModel.AddStep(new InitialStep {Name = "Start"}); 		
			semanticModel.AddStep(new ManualStep {Name = "ConcordeCustomerData", Role = "CustomerCare"}); 
			semanticModel.AddStep(new ManualStep {Name = "CheckPossibleDiscounts", Role = "CustomerCare"}); 
			semanticModel.AddStep(new DecisionStep {Name = "AreAllItemsOnStock"}); 		
			semanticModel.AddStep(new AutomaticStep {Name = "SendNotificationEmailToCustomer"}); 		
			semanticModel.AddStep(new ManualStep {Name = "OrderMissingItems", Role = "OrderHandling"}); 
			semanticModel.AddStep(new ManualStep {Name = "WaitForItemsToArrive", Role = "OrderHandling"}); 
			semanticModel.AddStep(new ManualStep {Name = "ShipItems", Role = "Inventory"}); 
			semanticModel.AddStep(new FinalStep {Name = "Finish"}); 		

			semanticModel.AddTransition("Start", "ConcordeCustomerData", "Start");
			semanticModel.AddTransition("ConcordeCustomerData", "CheckPossibleDiscounts", "ConcordanceReady");
			semanticModel.AddTransition("CheckPossibleDiscounts", "AreAllItemsOnStock", "DiscountCheckReady");
			semanticModel.AddTransition("AreAllItemsOnStock", "SendNotificationEmailToCustomer", "ItemsAreMissing");
			semanticModel.AddTransition("AreAllItemsOnStock", "ShipItems", "ItemsAreAvailable");
			semanticModel.AddTransition("SendNotificationEmailToCustomer", "OrderMissingItems", "EmailSent");
			semanticModel.AddTransition("OrderMissingItems", "WaitForItemsToArrive", "MissingItemsOrderDone");
			semanticModel.AddTransition("WaitForItemsToArrive", "ShipItems", "MissingItemsArrived");
			semanticModel.AddTransition("ShipItems", "Finish", "ItemsShipped");
	
			return semanticModel;
		}	
    }
}